package com.martin.fast_frame_compose.page.dialog

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.martin.fast_frame_compose.page.dialog.bottom.BottomDemoDialog
import com.martin.lib_base.ui.screen.CommonButton
import com.martin.lib_base.ui.theme.CommonTheme

/**
 * 弹窗功能主页
 */
@Composable
fun DialogPage(vModel: DialogViewModel) {
    CommonTheme(vModel) {
        Column(
            modifier = Modifier
                .fillMaxSize()
                .verticalScroll(rememberScrollState())
        ) {
            vModel.actionList.forEach {
                CommonButton(text = it, paddingHorizontal = 15.dp, paddingTop = 10.dp) {
                    vModel.onActionClick(it)
                }
            }
        }

        BottomDemoDialog(vModel.bottomModel)
    }
}